/*
TJ Daw

June 30th 2012

This is a sample project that counts from 0 to 7 using led and an arduino board.
*/
 
//LED on the Board
int binarypostition1 = 13;
//LED on Bread Board 1
int binarypostition2 = 12;
//LED on Bread Board 2
int binarypostition3 = 11;

int current = 0;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pins as an outputs.
  pinMode(binarypostition1, OUTPUT);   
  pinMode(binarypostition2, OUTPUT);     
  pinMode(binarypostition3, OUTPUT);     
} //End of Setup

// the loop routine runs over and over again forever:
void loop() {
  
 
    //Set the LED's on or off depending
    digitalWrite(binarypostition3, HIGH  && (current & B00000100));
    digitalWrite(binarypostition2, HIGH  && (current & B00000010));
    digitalWrite(binarypostition1, HIGH  && (current & B00000001));
  
    //Check to see if we need to reset the counter
    if (current > 7)
      current= 0; //Reset Counter
    else
      current++; //Increase Counter
  delay(1000);// wait for a second
} //End of Loop
